﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.Web;
using System.Web.Routing;
using System.Web.Mvc;

using Carmall.Entity;
using Carmall.BLL;


namespace Carmall.Web.Controllers
{
    public class ShopController : Controller
    {
        protected override void Initialize(RequestContext requestContext)
        {
            base.Initialize(requestContext);
            if (Session["CurrentUser"] == null)
                requestContext.HttpContext.Response.Redirect("/Home");
        }
        //
        // GET: /Shop/

        public ActionResult Index()
        {
            return View();
        }

        //
        // GET: /Shop/List
        public ActionResult List()
        {
            return View();
        }

        //
        // GET: /Shop/Search
        public ActionResult Search()
        {
            return View();
        }

        //
        // GET: /Shop/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /Shop/Create

        public ActionResult Create()
        {
            return View();
        } 

        //
        // POST: /Shop/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
        
        //
        // GET: /Shop/Edit/5
 
        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /Shop/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Shop/Delete/5
 
        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /Shop/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
    }
}
